package devaluator.functionality;

import java.util.Scanner;
import java.util.regex.Pattern;

public class GetProjectName {
	private String Pname=null;
	final String regexIface= "((\\n*)(\\s+)interface(\\s+))(([a-zA-Z_$][\\w$]*)(\\s*)((\\{)))";
	final String regexProj = "([a-zA-Z_$][\\w$]*)(\\s*)src";
	public String match(String aString){
			
		Scanner scanner = new Scanner(aString);
		Pattern p= Pattern.compile(regexProj);
		Pname=scanner.findWithinHorizon(p,0);
		if (Pname != null){
			Pname = Pname.replaceAll("[\\s]+src","");
		}
		
		return Pname;
	}
}
